package cs2340.lostmystuff;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.view.Menu;
import cs2340.lostmystuff.UserTable;

public class RegisterPage extends Activity {

	private EditText nuname;
	private EditText email;
	private EditText npass;
	
	public String nuser;
	public String nemail;
	public String nupass;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register_page);
        final UserTable u = new UserTable();
        nuname = (EditText) findViewById(R.id.nuname);
        email = (EditText) findViewById(R.id.nuem);
        npass = (EditText) findViewById(R.id.nupass);
        
        Button registeracc = (Button) findViewById(R.id.nacc);
        
        registeracc.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v){
        		nuser = nuname.getText().toString();
        		nemail = email.getText().toString();
        		nupass = npass.getText().toString();
        		u.addperson(nuser, nupass);
        		Intent myIntent = new Intent(RegisterPage.this, MainActivity.class);
        		startActivity(myIntent);
        		
        	}
        });
    }

}
